DAY17:A Needle in the Haystack


Posted by birdbirdmurmur on 2023-07-31

題目連結

A Needle in the Haystack

解法

function findNeedle(haystack) {
  return "found the needle at position " + haystack.indexOf("needle");
}

筆記

如何快速找到陣列中的索引? indexOf()
直接返回字串


#javascript #Codewars #indexOf







Related Posts

PHP 與 MySQL 的互動:讀取、新增、刪除、編輯資料

PHP 與 MySQL 的互動:讀取、新增、刪除、編輯資料

那些 React 跟 Redux 在一起的日子

那些 React 跟 Redux 在一起的日子

Python - 隨機模組(random)

Python - 隨機模組(random)


Comments